<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="./styles/main.css">
    <link rel="shortcut icon" type="image/x-icon" href="./images/favicon.png">

    <title>Boss直聘-互联网招聘神器</title>
</head>

<body>
    <div class="container" id="app">

        <div class="home-header">
            <div class="home-banner">
                <img src="./images/home-search-text.png" alt="">
            </div>
            <form action="">
                <input type="text" placeholder="搜索职位公司">
                <button>搜索</button>
            </form>
        </div>
        <div class="home-categories">
            <dl v-for="item in categories" :key="item.id">
                <dt>
                    <img :src="item.icon" alt="">
                    <div>{{item.name}}</div>
                </dt>
                <dd>
                    <a :href="'./list.html?cate='+tag.name" class="tag" v-for="tag in item.tags"
                        :key="tag.id">{{tag.name}}</a>

                </dd>
            </dl>

        </div>
        <div class="home-footer">
            <p>违法和不良信息举报邮箱：jubao@kanzhun.com</p>
            <p>企业服务热线和举报投诉：400 065 5799</p>
        </div>
    </div>
    <script type="text/javascript" src="./script/vue/vue.js"></script>
    <script>
        //view model
        const vm = new Vue({
            el: '#app',
            data: {
                categories: []
            },
            created: function () {
                //axios
                const that = this
                fetch('http://127.0.0.1:5500/Vue-Boss/api/mockData/index.json').then(function (res) {
                    return res.json()
                }).then((data) => {
                    that.categories = data.result
                    //console.log(data)
                })
            },
        })
    </script>
</body>

</html>